| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

ShaderPassMemorySlot.h
1 // ShaderPassMemorySlot.h
3 //
5
6 namespace nkGraphics
7 {
14 class ShaderPassMemorySlot : public ShaderMemorySlot
15 {
16 public :
17
21 enum class DATA_TYPE
22 {
23 UNKNOWN = 0,
24 VECTOR,
25 MATRIX,
26 CAM_CORNERS_WORLD,
27 CAM_CORNERS_VIEW,
28 TARGET_SIZE,
29 PROJECTION_PARAMS,
30 TEXTURE_SIZE,
31 VIEW_MATRIX,
32 VIEW_MATRIX_INV,
33 PROJ_MATRIX,
34 PROJ_MATRIX_INV,
35 CAM_POSITION,
36 CAM_DIRECTION_WORLD,
37 TIME,
38 CUSTOM
39 } ;
40
41 public :
42
48 ShaderPassMemorySlot (System* system) noexcept ;
52 virtual ~ShaderPassMemorySlot () ;
53
54 // Getters
58 void* getData () const ;
62 virtual unsigned int getDataSize () const ;
66 virtual nkMemory::StringView getDataTypeAsString () const override ;
70 DATA_TYPE getType () const ;
74 nkMaths::Vector* getDataAsVector () const ;
78 nkMaths::Matrix* getDataAsMatrix () const ;
79
80 // Setters
87 void setFromVector (const nkMaths::Vector& data) ;
94 void setFromMatrix (const nkMaths::Matrix& data) ;
101 void setAsCamCornersWorld (Camera* forcedCamera = nullptr) ;
108 void setAsCamCornersView (Camera* forcedCamera = nullptr) ;
125 void setAsTargetSize () ;
148 void setAsProjectionParameters (Camera* forcedCamera = nullptr) ;
160 void setAsViewMatrix (Camera* forcedCamera = nullptr) ;
167 void setAsViewMatrixInv (Camera* forcedCamera = nullptr) ;
179 void setAsProjectionMatrix (Camera* forcedCamera = nullptr) ;
186 void setAsProjectionMatrixInv (Camera* forcedCamera = nullptr) ;
193 void setAsCameraPosition (Camera* forcedCamera = nullptr) ;
200 void setAsCameraDirectionWorld (Camera* forcedCamera = nullptr) ;
217 void setAsTextureSize (Texture* tex) ;
236 void setAsTime (unsigned int modulo) ;
242 void setAsCustom (nkMemory::UniquePtr<ShaderPassCustomSlot> slot) ;
243
244 // Import / Export
245 virtual void exportClassToTree (nkExport::Node* rootNode) override ;
246 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
247 } ;
248 }
nkGraphics::ShaderPassMemorySlot::getDataAsMatrix
nkMaths::Matrix * getDataAsMatrix() const
nkGraphics::ShaderPassMemorySlot::ShaderPassMemorySlot
ShaderPassMemorySlot(System *system) noexcept
nkGraphics::ShaderPassMemorySlot::setAsProjectionParameters
void setAsProjectionParameters(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::TIME
@ TIME
Writes information about time (float4).
nkGraphics::ShaderMemorySlot
A memory slot in a memory resource.
Definition: ShaderMemorySlot.h:15
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::VIEW_MATRIX_INV
@ VIEW_MATRIX_INV
Writes the active inverse view matrix (float4x4).
nkGraphics::ShaderPassMemorySlot::setAsViewMatrix
void setAsViewMatrix(Camera *forcedCamera=nullptr)
nkGraphics::System
Main interface with the component system.
Definition: System.h:14
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::CAM_POSITION
@ CAM_POSITION
Writes the active camera position (float4).
nkGraphics::Camera
Offers all controls to model a camera.
Definition: Camera.h:14
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::VECTOR
@ VECTOR
Writes a vector (float4).
nkGraphics::ShaderPassMemorySlot::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkGraphics::Texture
A texture used for rendering, hosted on GPU.
Definition: Texture.h:12
nkGraphics::ShaderPassMemorySlot::setAsProjectionMatrix
void setAsProjectionMatrix(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::getType
DATA_TYPE getType() const
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::CUSTOM
@ CUSTOM
Uses a custom slot made by external code.
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::TEXTURE_SIZE
@ TEXTURE_SIZE
Writes a given texture's size (int4).
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::CAM_CORNERS_VIEW
@ CAM_CORNERS_VIEW
Writes the cam corners direction in view space (float4 [4]).
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::TARGET_SIZE
@ TARGET_SIZE
Writes the active render target size (int4).
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:14
nkGraphics::ShaderPassMemorySlot::setAsProjectionMatrixInv
void setAsProjectionMatrixInv(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::PROJECTION_PARAMS
@ PROJECTION_PARAMS
Writes the projection parameters (float4).
nkGraphics::ShaderPassMemorySlot::DATA_TYPE
DATA_TYPE
Definition: ShaderPassMemorySlot.h:22
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::VIEW_MATRIX
@ VIEW_MATRIX
Writes the active view matrix (float4x4).
nkGraphics::ShaderPassMemorySlot::getDataTypeAsString
virtual nkMemory::StringView getDataTypeAsString() const override
nkGraphics::ShaderPassMemorySlot::setAsCamCornersView
void setAsCamCornersView(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot
A memory slot that fits into a ConstantBuffer. The slot fills entries within the buffer.
Definition: ShaderPassMemorySlot.h:15
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::PROJ_MATRIX_INV
@ PROJ_MATRIX_INV
Writes the active inverse projection matrix (float4x4).
nkGraphics::ShaderPassMemorySlot::getDataAsVector
nkMaths::Vector * getDataAsVector() const
nkGraphics::ShaderPassMemorySlot::setFromVector
void setFromVector(const nkMaths::Vector &data)
nkGraphics::ShaderPassMemorySlot::getData
void * getData() const
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::MATRIX
@ MATRIX
Writes a matrix (float4x4).
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::ShaderPassMemorySlot::setAsCameraDirectionWorld
void setAsCameraDirectionWorld(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::setAsViewMatrixInv
void setAsViewMatrixInv(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::UNKNOWN
@ UNKNOWN
Unknown place holder.
nkGraphics::ShaderPassMemorySlot::getDataSize
virtual unsigned int getDataSize() const
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkGraphics::ShaderPassMemorySlot::setAsTextureSize
void setAsTextureSize(Texture *tex)
nkGraphics::ShaderPassMemorySlot::setAsCustom
void setAsCustom(nkMemory::UniquePtr< ShaderPassCustomSlot > slot)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::CAM_CORNERS_WORLD
@ CAM_CORNERS_WORLD
Writes the cam corners direction in world space (float4 [4]).
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::CAM_DIRECTION_WORLD
@ CAM_DIRECTION_WORLD
Writes the active camera direction (float4).
nkGraphics::ShaderPassMemorySlot::~ShaderPassMemorySlot
virtual ~ShaderPassMemorySlot()
nkGraphics::ShaderPassMemorySlot::DATA_TYPE::PROJ_MATRIX
@ PROJ_MATRIX
Writes the active projection matrix (float4x4).
nkGraphics::ShaderPassMemorySlot::setAsTargetSize
void setAsTargetSize()
nkGraphics::ShaderPassMemorySlot::setAsTime
void setAsTime(unsigned int modulo)
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::ShaderPassMemorySlot::setAsCameraPosition
void setAsCameraPosition(Camera *forcedCamera=nullptr)
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkGraphics::ShaderPassMemorySlot::setAsCamCornersWorld
void setAsCamCornersWorld(Camera *forcedCamera=nullptr)
nkGraphics::ShaderPassMemorySlot::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkGraphics::ShaderPassMemorySlot::setFromMatrix
void setFromMatrix(const nkMaths::Matrix &data)